DROP TABLE IF EXISTS jms_ods.yl_lmdm_sys_dictionary;
CREATE EXTERNAL TABLE jms_ods.yl_lmdm_sys_dictionary(
 ID bigint comment "",  --NUMBER(11)
 NAME string comment "名称",  --NVARCHAR2(60)
 EN_NAME string comment "英文名称",  --NVARCHAR2(60)
 CODE string comment "编码",  --NVARCHAR2(60)
 CN_NAME string comment "中文名称",  --NVARCHAR2(60)
 KIND smallint comment "类型",  --NUMBER(4)
 CATEGORY_ID bigint comment "模块ID",  --NUMBER(11)
 IS_ENABLE smallint comment "是否启用:1启用,2不启用",  --NUMBER(4)
 IS_DELETE smallint comment "是否删除:1未删除,2已删除",  --NUMBER(4)
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 UPDATE_BY bigint comment "最后更新人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人名称",  --NVARCHAR2(50)
 UPDATE_BY_NAME string comment "最后修改人名称",  --NVARCHAR2(50)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 VERSION string comment "版本号",  --NVARCHAR2(10)
 SORT smallint comment "排序"  --NUMBER(4)
 )
 COMMENT '字典详情'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_lmdm_sys_dictionary'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_lmdm_sys_dictionary;